From a9a59ac55e01333f8e72ac8807eb6d4c9a9f5017 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Fri, 10 Jun 2016 21:16:53 +0900 Subject: [PATCH] scrolledwindow: Fix calls to gdk_window_move_resize() This is a bit of fallout from 34feba1, now that we resolve the has_indicators value earlier than realize, it becomes possible to call gdk_window_move_resize() before realization. Just added the appropriate checks. --- gtk/gtkscrolledwindow.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 7d149aee36..df7302c8f8 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -1710,11 +1710,12 @@ gtk_scrolled_window_allocate (GtkCssGadget *gadget, &child_allocation); if (priv->use_indicators) { - gdk_window_move_resize (priv->hindicator.window, - child_allocation.x, - child_allocation.y, - child_allocation.width, - child_allocation.height); + if (gtk_widget_get_realized (widget)) + gdk_window_move_resize (priv->hindicator.window, + child_allocation.x, + child_allocation.y, + child_allocation.width, + child_allocation.height); child_allocation.x = 0; child_allocation.y = 0; } @@ -1729,11 +1730,12 @@ gtk_scrolled_window_allocate (GtkCssGadget *gadget, &child_allocation); if (priv->use_indicators) { - gdk_window_move_resize (priv->vindicator.window, - child_allocation.x, - child_allocation.y, - child_allocation.width, - child_allocation.height); + if (gtk_widget_get_realized (widget)) + gdk_window_move_resize (priv->vindicator.window, + child_allocation.x, + child_allocation.y, + child_allocation.width, + child_allocation.height); child_allocation.x = 0; child_allocation.y = 0; } -- 2.30.2